﻿using CommandLine;

namespace OfficeConvert
{
    class Program
    {
        static void Main(string[] args)
        {
#if DEBUG
            //args = new string[] { "Convert","-s", "file.docx", "--tn", "file.pdf" };
#endif
            var result = Parser.Default.ParseArguments<OfficeVonvertOptions>(args);
            result.MapResult(
            options =>
            {
                return RunAndReturnExitCode(options);
            }
            , _ => 1);
        }

        static int RunAndReturnExitCode(OfficeVonvertOptions options)
        {

            options.Execute();
            return 0;
        }
    }
}
